import request from '@/utils/request'

// 创建作业活动
export function createTaskWork(data) {
  return request({
    url: '/biz/task-work/create',
    method: 'post',
    data: data
  })
}

// 更新作业活动
export function updateTaskWork(data) {
  return request({
    url: '/biz/task-work/update',
    method: 'put',
    data: data
  })
}

// 删除作业活动
export function deleteTaskWork(id) {
  return request({
    url: '/biz/task-work/delete?id=' + id,
    method: 'delete'
  })
}

// 获得作业活动
export function getTaskWork(id) {
  return request({
    url: '/biz/task-work/get?id=' + id,
    method: 'get'
  })
}

// 获得作业活动分页
export function getTaskWorkPage(query) {
  return request({
    url: '/biz/task-work/page',
    method: 'get',
    params: query
  })
}

// 导出作业活动 Excel
export function exportTaskWorkExcel(query) {
  return request({
    url: '/biz/task-work/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

//下载模板
export function downTaskTemplate(){
  return request({
    url: '/biz/task-work/downTaskTemplate',
    method: 'post',
    responseType: 'blob'
  })
}
